package action;

import com.opensymphony.xwork2.ActionSupport;
import model.Dish;
import service.DishService;

import java.util.List;

/**
 * Created by Trialiet on 2016/9/1.
 */
public class DishAction extends ActionSupport {
    private DishService dishService;
    private List<Dish> data;

    public void setDishService(DishService dishService) {
        this.dishService = dishService;
    }

    public String addNewDish(){
        for(Dish d : data){
            dishService.saveDish(d);
        }
        return SUCCESS;
    }

    public List<Dish> getData() {
        return data;
    }

    public void setData(List<Dish> data) {
        this.data = data;
    }
}
